/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.model;

import br.com.foxline.enums.AnualCorrection;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;

/**
 *
 * @author ely
 * 
 * Empreendimento
 */
@Entity
public class Enterprise implements Serializable{
    
    @Id
    @SequenceGenerator(sequenceName = "seq_enterprise", name = "seq_enterprise", allocationSize = 1)
    @GeneratedValue(generator = "seq_enterprise", strategy = GenerationType.SEQUENCE)
    private Long id;
    
    private String name;
    
    private String description;
    
    private Integer qtdBlock;
    
    private Integer qtdLot;
    
    @Column(scale= 2, precision=19)
    @DecimalMin( value = "0.00" )
    @Digits( fraction = 2, integer = 10 )
    private BigDecimal porcBegin;
    
    @OneToMany
    private List<InterestParcel> interestParcels; //juros parcelas
    
    @OneToOne(fetch= FetchType.EAGER)
    private Construction construction;
    
    @OneToMany
    private List<Corrector> correctors;
    
    @OneToMany(cascade=CascadeType.ALL)
    private List<Annex> annexs;
    
    private String numRegistryNotary;
    
    private String nameNotary;
    
    private String bookNotary;
    
    private String leafNotary;
    
    @Column(scale= 2, precision=19)
    @DecimalMin( value = "0.00" )
    @Digits( fraction = 2, integer = 10 )
    private BigDecimal porcInadiplencia;
    
    @OneToOne
    private City city;
    
    @OneToMany
    private List<TypeLot> typeLots;
    
    /**
     * Usuário que cadastrou
     */
    @ManyToOne
    private SystemUser systemUser;
    
    @ManyToOne
    private Users admin;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date create_at;

    
    @Enumerated(EnumType.STRING)
    private AnualCorrection anualCorrection;

    public AnualCorrection getAnualCorrection() {
        return anualCorrection;
    }

    public void setAnualCorrection(AnualCorrection anualCorrection) {
        this.anualCorrection = anualCorrection;
    }
    
    
    public List<TypeLot> getTypeLots() {
        return typeLots;
    }

    public void setTypeLots(List<TypeLot> typeLots) {
        this.typeLots = typeLots;
    }
    
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public BigDecimal getPorcInadiplencia() {
        return porcInadiplencia;
    }

    public String getBookNotary() {
        return bookNotary;
    }

    public void setBookNotary(String bookNotary) {
        this.bookNotary = bookNotary;
    }

    public String getLeafNotary() {
        return leafNotary;
    }

    public void setLeafNotary(String leafNotary) {
        this.leafNotary = leafNotary;
    }

    public void setPorcInadiplencia(BigDecimal porcInadiplencia) {
        this.porcInadiplencia = porcInadiplencia;
    }

    
    public List<Annex> getAnnexs() {
        return annexs;
    }

    public void setAnnexs(List<Annex> annexs) {
        this.annexs = annexs;
    }

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    public Construction getConstruction() {
        return construction;
    }

    public void setConstruction(Construction construction) {
        this.construction = construction;
    }

    public List<Corrector> getCorrectors() {
        return correctors;
    }

    public void setCorrectors(List<Corrector> correctors) {
        this.correctors = correctors;
    }

    public Date getCreate_at() {
        return create_at;
    }

    public void setCreate_at(Date create_at) {
        this.create_at = create_at;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

  

    public List<InterestParcel> getInterestParcels() {
        return interestParcels;
    }

    public void setInterestParcels(List<InterestParcel> interestParcels) {
        this.interestParcels = interestParcels;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNameNotary() {
        return nameNotary;
    }

    public void setNameNotary(String nameNotary) {
        this.nameNotary = nameNotary;
    }

    public String getNumRegistryNotary() {
        return numRegistryNotary;
    }

    public void setNumRegistryNotary(String numRegistryNotary) {
        this.numRegistryNotary = numRegistryNotary;
    }

    public BigDecimal getPorcBegin() {
        return porcBegin;
    }

    public void setPorcBegin(BigDecimal porcBegin) {
        this.porcBegin = porcBegin;
    }

    public Integer getQtdBlock() {
        return qtdBlock;
    }

    public void setQtdBlock(Integer qtdBlock) {
        this.qtdBlock = qtdBlock;
    }

    public Integer getQtdLot() {
        return qtdLot;
    }

    public void setQtdLot(Integer qtdLot) {
        this.qtdLot = qtdLot;
    }

    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }

    public Users getAdmin() {
        return admin;
    }

    public void setAdmin(Users admin) {
        this.admin = admin;
    }
    
    
    
}
